package com.alinesno.cloud.portal.auto.task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
 
/**
 * 异步任务执行器
 * @author WeiXiaoJin
 * @since 2019年11月22日 上午8:13:27
 */
@Component
public class AsyncTaskExecutor {
	
    private static Logger LOG = LoggerFactory.getLogger(AsyncTaskExecutor.class);
    
    @Async
    public void executor(AsyncTaskConstructor asyncTaskGenerator, String taskInfo) {
        LOG.info("AsyncTaskExecutor is executing async task:{}", taskInfo);
        asyncTaskGenerator.async();
    }
}